﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Work.BL.Managers;
using Work.UI.Web.Forms.Code.Common;

namespace Work.UI.Web.Forms.Admin.Users
{
    public partial class Insert : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void odsUser_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
        {
            IUserManager regionManager = IoCContainer.ServiceLocator.Resolve<IUserManager>();
            e.ObjectInstance = regionManager;
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            frvUser.InsertItem(true);
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Admin/Users/Default.aspx");
        }

        protected void frvUser_ItemInserted(object sender, FormViewInsertedEventArgs e)
        {
            Response.Redirect("~/Admin/Users/Default.aspx");
        }
    }
}